from typing import Optional
from datetime import datetime
from pydantic import BaseModel, ConfigDict
from .base_schema import BaseSchema


class AccountBase(BaseSchema):
    #id: int
    account_no: str
    user_name: str
    currency: str
    status: int

class SubAccount(BaseSchema):
    sub_acc_no: int
    sub_type: int
    balance: int
    status: int

class AccountInfo(AccountBase):
    sub_accounts: list[SubAccount] = []
    create_time: Optional[datetime]
    update_time: Optional[datetime]

class SubAccountInfo(BaseModel):
    balance: SubAccount
    frozen: SubAccount
    pending: SubAccount

class FullAccountInfo(BaseModel):
    account: AccountBase
    sub_acc_info: SubAccountInfo

